<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <home-page></home-page>
  </div>
  <script src="./vue.js"></script>
  <script>
    const Home = {
      /* 
        render 参数 createElement函数才真正是创建虚拟dom节点

        render return 出 createElement创建虚拟dom节点
      */
      render: createElement => {
        return createElement(
          'div', 
          {
            'class': ['box', {a: true, active: true}],
            style: {
              color: 'red'
            },
            attrs: {
              id: 'aaaa'
            }
          },
          [
            createElement('p',{class:'op'}, ['你是p']),
            createElement('span',{}, ['你是span']),
            '这是文本节点'
          ]
        )
      }
    }
    Vue.component('HomePage', Home)
    const vm = new Vue({
      el: '#app',
      data: {
        isShow: true
      }
    })
  </script>
</body>
</html>